package kr.hkit.powerjava.chapter14.windowbuilder;

import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.HeadlessException;

import javax.swing.JFrame;

class MyFrame extends JFrame{

	public MyFrame(String title) throws HeadlessException {
		super(title);
		init();
	}

	private void init() {
		setSize(450, 300);
		setLayout(new BorderLayout(30, 30));
		/*
		BorderLayout layout = (BorderLayout) getLayout();
		layout.setVgap(30);
		layout.setHgap(30);*/
		
		add(new Button("Center"),BorderLayout.CENTER);
		add(new Button("Page Start"),BorderLayout.NORTH);
		add(new Button("Page End"),BorderLayout.PAGE_END);
		add(new Button("Line Start"),BorderLayout.LINE_START);
		add(new Button("Line End"),BorderLayout.LINE_END);
		
		setVisible(true);
		
		
	}
	
}
public class BoardLayoutEx {
	public static void main(String[] args) {
		new MyFrame("BorderLayout 예제");
	}
}
